package com.zhan.ielts.enums;

public enum OperationSysEnum {
	IOS(1, "iPhone"), Android(2, "android");
	private Integer index;

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private String name;

	private OperationSysEnum(Integer index, String name) {
		this.index = index;
		this.name = name;
	}

	public static String getNameByIndex(Integer index) {
		for (OperationSysEnum e : OperationSysEnum.values()) {
			if (e.getIndex().equals(index)) {
				return e.getName();
			}
		}
		return null;
	}
}
